A Universal Serial Bus (USB) device in compliance with the USB 2.0 specification is typically a Dual Role Device (DRD) device, which can be acted as a master device, also can be acted as a slave device. As illustrated in FIG. 1a, which is a schematic structural diagram of a USB device in compliant with the USB 2.0 specification, connection pins of the USB device include a VBUS pin, an ID pin, a GND pin and D+ and D− pins, and the USB device internally includes a data transceiver circuit having outputs connected to the D+ pin and D− pin through D+ data line and D− data line and a VBUS drive control module connected to the VBUS pin through a VBUS data line, where the D+ data line is grounded through a pull-down resistor R4 and a switch S4, and the D− data line is grounded through a pull-down resistor R5 and a switch S5, and if the USB device is a high-speed or full-speed device, then the D+ data line is connected to a power supply VCC through a pull-up resistor R1 and a switch S1, and if the USB device is a low-speed device, then the D− data line is connected to VCC through the pull-up resistor R1 and the switch S1 as illustrated in FIG. 1b. 
The existing USB DRD identifies whether the present USB device is a master device or a slave device at a specific time point by taking a level of the ID pin among the connection pins of the USB device as a criterion so that the USB device is a USB slave device if the level of the ID pin is a high level and a master device if level of the ID pin is a low level. However, this detection method has such a drawback that a resource of one pin in a chip of the USB device has to be occupied, because the ID pin is required in the USB device.